<template>
  <div>
    <div class="item">
      <van-icon
        name="bars"
        size="40"
        style="float: left; line-height: 40px"
        @click="onlist"
      />
      <van-search
        v-model="title"
        shape="round"
        background="#4fc08d"
        placeholder="请输入搜索关键词"
        @search="onSearch"
      />
      <div
        style="float: left; line-height: 40px; font-size: 20px"
        @click="onlogin"
      >
        登录
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRoute, useRouter } from "vue-router";

const router = useRouter();
const route = useRoute();

const onSearch = () => {
  router.push({ name: "search", params: {} });
};
const onlogin = () => {
  router.push({ path: "/login", query: {} });
};
const onlist = () => {
  router.push({ path: "/home/list", query: {} });
};
</script>

<style lang="scss" scoped>
.van-search {
  float: left;
  width: 77%;
  height: 40px;
}
</style>
